﻿#region Using Directives

    using System;

    using Csla;

    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Private
{
    /// <summary>
    /// This class represents an indiviual event that a Assignment can exerience during it's lifecycle.
    /// This class has no data access factory and as such cannot be persisted outside of a Assignment object. 
    /// 
    /// Instances of this object belong to a Assignment object and their persistence and general management are handled by their owner (Assignment object).
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.AssignmentFactory, MarketPulse.DataAccess.Factory", "CreateEvent", "")]
    public class AssignmentEvent : MarketPulseBase<AssignmentEvent>
    {
        #region Member Variables

            /// <summary>
            /// The ID of the associated Assignment 
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> mAssignmentGuidProperty = RegisterProperty<Nullable<Guid>>(p => p.AssignmentGuid);

            /// <summary>
            /// The GUID of the associated AssignmentEventType
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> mAssignmentEventTypeGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.AssignmentEventTypeGuid);

        #endregion

        #region Constructors

        /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private AssignmentEvent()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method that creates a new AssignmentEvent via the DataPortal client proxy
                /// </summary>
                /// <returns>The newly created Assignment object</returns>
                public static AssignmentEvent New()
                {
                    return DataPortal.Create<AssignmentEvent>();
                }

            #endregion

        #endregion

        #region Properties

            /// <summary>
            /// The ID of the associated Assignment 
            /// </summary>
            public Nullable<Guid> AssignmentGuid
            {
                get { return GetProperty(mAssignmentGuidProperty); }
                set { SetProperty(mAssignmentGuidProperty, value); }
            }

            /// <summary>
            /// The GUID of the associated AssignmentEventType
            /// </summary>
            public Nullable<Guid> AssignmentEventTypeGuid
            {
                get { return GetProperty(mAssignmentEventTypeGUIDProperty); }
                set { SetProperty(mAssignmentEventTypeGUIDProperty, value); }
            }

        #endregion

    }
}
